package com.hup.utils.commons.exception;

/**
 * @author hugan
 * @date 2019/8/24
 */
public class ErrInfo {
    private String errMsg;
    private String trace;

    public void setMsg(String msgHead, String msg) {
        errMsg = msgHead == null ? msg : msgHead + msg;
    }

    public void setTrace(String trace) {
        this.trace = trace;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public String getTrace() {
        return trace;
    }

    @Override
    public String toString() {
        if (trace == null) {
            return errMsg;
        }
        return errMsg + trace;
    }
}
